home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / windows / 2ndpw100.zip / 2NDPW.WAS
Text File  |  1992-10-20  |  5KB  |  72 lines

  1. ; 2NDPW.WAS v1.00 - Starts second session of PW on a different port
  2. ;****************************************************************************
  3. ;*                                                                          *
  4. ;* 2NDPW.WAS                                                                *
  5. ;* Copyright (C) 1992 Datastorm Technologies, Inc.                          *
  6. ;* All rights reserved.                                                     *
  7. ;*                                                                          *
  8. ;* Purpose:  Starts a second session of PW on another port.  Both           *
  9. ;*           PW windows are sized to the specs in the #DEFINE block.        *
  10. ;*           This script is handy when run from either a Meta Key or        *
  11. ;*           an icon in Program Manager                                     *
  12. ;*                                                                          *
  13. ;* This ASPECT SCRIPT is intended only as a sample of ASPECT programming.   *
  14. ;* DATASTORM makes no warranty of any kind, express or implied, including   *
  15. ;* without limitation, any warranties of merchantability and/or fitness     *
  16. ;* for a particular purpose.  Use of this program is at your own risk.      *
  17. ;*                                                                          *
  18. ;* Author:  Chuck Spohr                                                     *
  19. ;*                                                                          *
  20. ;****************************************************************************
  21.  
  22. ;****************************************************************************
  23. ;*   GLOBAL DEFINES                                                         *
  24. ;****************************************************************************
  25.  
  26. #define WTOP      24                    ; Position of top of 1st window (pix)
  27. #define WBOTTOM   $YPIXELS - 64         ; Position of bottom of 2nd window
  28. #define WLEFT     0                     ; Left position of both windows
  29. #define WWIDTH    $XPIXELS              ; Width of both windows
  30. #define OVERLAP   64                    ; Number of pixels to overlap
  31. #define CONNECT_1 "direct connect-COM3" ; Use 0 to indicate default connection
  32. #define CONNECT_2 "direct connect-COM4"
  33.  
  34. ;****************************************************************************
  35. ;*                                                                          *
  36. ;* MAIN                                                                     *
  37. ;* The Main procedure backs up the PW.PRM file, saves a new .PRM file,      *
  38. ;* records the dimensions of the current window, resizes it, starts 2nd     *
  39. ;* session, resizes it, and finally restores PW.PRM.                        *
  40. ;*                                                                          *
  41. ;* Calls:  none                                                             *
  42. ;* Modifies globals:  none                                                  *
  43. ;*                                                                          *
  44. ;****************************************************************************
  45.  
  46. proc main
  47.    integer ThisWin, PWLeft, PWTop, PWWidth, PWHeight, WHeight, PW2Win, W2Top
  48.    string ParmPath = $PWTASKPATH, TmpPath= $PWTASKPATH
  49.    
  50.    addfilename ParmPath "PW.PRM"       ; Assemble path and filename of PW.PRM
  51.    addfilename TmpPath "TEMP.PRM"      ; Create a name for the temporary .PRM
  52.    copyfile ParmPath TmpPath           ; Back up PW.PRM to temporary name
  53.  
  54.    set connection type CONNECT_2 DEFAULT  ; Make 2nd connection default
  55.    savesetup                              ; and save it to PW.PRM
  56.    set connection type CONNECT_1          ; Switch back to 1st connection
  57.    
  58.    ThisWin = $ACTIVEWIN                            ; Save ID of PW window
  59.    wincoord ThisWin PWLeft PWTop PWWidth PWHeight  ; Save coordinates of PW
  60.    WHeight = (WBOTTOM - WTOP + OVERLAP) / 2        ; Calculate new size
  61.    sizewin ThisWin WLEFT WTOP WWIDTH WHeight       ; Resize PW Window
  62.    
  63.    W2Top = WTOP + WHeight - OVERLAP         ; Calculate position of 2nd window
  64.    run "C:\PROWIN\PW.EXE"                   ; Start up 2nd session
  65.    PW2Win = $ACTIVEWIN                      ; Get window ID of 2nd session
  66.    sizewin PW2Win 0 W2Top $XPIXELS WHeight  ; Resize the window
  67.    activatewin ThisWin                      ; Give 1st session focus
  68.  
  69.    copyfile TmpPath ParmPath                ; Restore the .PRM file
  70.    delfile TmpPath                          ; Delete the temp
  71. endproc
  72.